package com.hxzy.mapper;

import com.hxzy.controller.admin.product.req.ProductSearchReq;
import com.hxzy.controller.admin.product.resp.ProductResp;
import com.hxzy.controller.mobile.product.req.MobileProductReq;
import com.hxzy.controller.mobile.product.resp.MobileProductResp;
import com.hxzy.entity.Product;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author admin
* @description 针对表【product(商品信息)】的数据库操作Mapper
* @createDate 2024-02-21 11:30:41
* @Entity com.hxzy.entity.Product
*/
public interface ProductMapper extends BaseMapper<Product> {


    List<ProductResp> search(@Param(value = "req") ProductSearchReq req);

    /**
     * 商品信息
     * @param req
     * @return
     */
    List<MobileProductResp> mobileSearch(@Param(value = "req") MobileProductReq req);

    /**
     * 扣库存
     * @param buyNumber
     * @param productDb
     * @return
     */
    long deduceNum(@Param(value = "buyNumber") Integer buyNumber, @Param(value = "req") Product productDb);
}




